// API配置文件
const config = {
  // 云开发环境ID - 请替换为你的实际环境ID
  envId: 'your-env-id-here',  // 请在微信开发者工具中创建云开发环境后，将此处替换为您的实际环境ID
  
  // 服务器地址配置
  baseUrl: {
    development: 'http://localhost:9999',  // 开发环境
    test: 'http://test-api.example.com',   // 测试环境
    production: 'https://api.example.com'  // 生产环境
  },

  // 当前环境
  env: 'development',  // 可选值：development, test, production

  // API路径
  apiPath: {
    // 用户相关
    user: {
      login: '/auth/login'
    },
    // 活动相关
    activity: {
      create: '',
      list: '/coach/activities',
      task: '/coach/activity/task',
      dealcalcAmount: '/coach/activity/dealcalcAmount',
      update: '/coach/activity/update',
      delete: '/api/activity/delete'
    },
    // 任务相关
    task: {
      create: '/api/task/create',
      list: '/api/task/list',
      detail: '/api/task/detail',
      update: '/api/task/update',
      delete: '/api/task/delete'
    }
  },
  
  // 云函数名称
  cloudFunctions: {
    createActivity: 'createActivity',
    getActivityList: 'getActivityList',
    getActivityDetail: 'getActivityDetail',
    updateActivity: 'updateActivity',
    deleteActivity: 'deleteActivity',
    createTask: 'createTask',
    getTaskList: 'getTaskList',
    updateTask: 'updateTask',
    deleteTask: 'deleteTask'
  },

  // 数据库集合名称
  collections: {
    activities: 'activities',
    tasks: 'tasks',
    users: 'users'
  },

  // 其他配置
  defaultPageSize: 10,
  maxPageSize: 50,

  // 获取完整的API URL
  getApiUrl: function(path) {
    return this.baseUrl[this.env] + path
  }
}

module.exports = config 